
<template>
  <div class="form-design-setting-container">
    <el-form size="" label-width="100px" label-position="left">
      <!-- <el-tabs v-model="tabs1">
        <el-tab-pane label="题目设置" name="1">
          <el-form-item label="一页一题">
            <el-switch v-model="formDesign.onePageOneQs" inline-prompt active-text="开启" inactive-text="关闭" :active-value="true" :inactive-value="false" @change="handleOnePageOneQs"/>
          </el-form-item>
        </el-tab-pane>
      </el-tabs> -->
    </el-form>
  </div>
</template>

<script setup>
// import { ref, computed } from "vue";
// import { useStore } from 'vuex'

// const tabs1 = ref('1')
// const store = useStore()
// const pagenation = {
//   type: "pagenation",
//   label: "",
//   compName: '分页', //组件名
//   width:'100%', //宽度
//   qsList: [], //当前页的题目
//   default: null,
// }
// const formDesign = computed(()=>{return store.getters.formDesignInfo})
// const formComponents = computed(() => {return formDesign.value.formItemList || []});
// const handleOnePageOneQs = (val) => {
//   let newList = []
//   if(val){ //开启一页一题
//     let cpmArr = formComponents.value.filter(item=>item.type != 'pagenation' && item.type != 'secondTitle')
//     cpmArr.forEach(cmp =>{
//       newList.push(handelAddPagenaiton(pagenation))
//       newList.push(cmp)
//     })
//     formDesign.value.formItemList = newList
//   }
//   else{
//     formDesign.value.formItemList = formDesign.value.formItemList.filter(item => item.type != 'pagenation')
//   }
// }
// // 给所有组件添加分页器
// const handelAddPagenaiton = (cmp) => {
//   const newCmp = JSON.parse(JSON.stringify(cmp));
//   // 生成唯一id
//   if (!newCmp.formItemId) newCmp.formItemId = newCmp.type + "_" + Date.now() + "_" + Math.ceil(Math.random() * 99999);
//   return newCmp
// }
</script>

<style lang="scss" scoped>
</style>
